﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_project_AddProject : System.Web.UI.Page
{
    static User currentUser;

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void btnCreate_Click(object sender, EventArgs e)
    {
        ProjectManagement projectManagement = new ProjectManagement(Master.Master.CurrentUserManagement.CurrentUser);
        int projectId = projectManagement.AddProject(txtProjectName.Text, txtDescription.Text, txtCustomMessage.Text);
        if (projectId == -1)
            ltrError.Text = "Project creation failed due to Database Eror!";
        else
        {
            ltrError.Text = "Project created successfully with ID: " + projectId;
            txtCustomMessage.Text = "";
            txtDescription.Text = "";
            txtProjectName.Text = "";
        }
    }
}